package _Pan3D.program.shaders
{
	import _Pan3D.program.Shader3D;
	
	public class GlassShader extends Shader3D
	{
		public static var GLASS_SHADER:String = "GLASS_SHADER";
		public function GlassShader()
		{
			vertex = 
				"mov vt0, va2, \n"+
				"add vt0,vt0, va0, \n"+
				"m44 v7, vt0, vc12 \n" +
				"m44 vt0, vt0, vc4 \n" +
				"m44 op, vt0, vc0 \n" +
				"mov v6, va0 \n" +
				"mov v1, va1";
			fragment =
				"tex ft0, v1, fs1 <2d,clamp,repeat>\n"+
				"slt ft2.w,fc5.w,ft0.w\n"+
				"sub ft2.w, ft2.w, fc5.x\n"+
				"kil ft2.w\n"+
				
				"mov ft5,v7\n"+
				"div ft5,ft5,ft5.z \n"+
				"neg ft5.y,ft5.y \n"+
				"add ft4,ft5,fc2.z \n"+
				"tex ft5, ft4, fs0 <2d,2d,2d>\n"+  
				
				"sub ft6.w,fc2.w,ft5.w\n"+
				"mul ft0.xyz,ft0.xyz,ft6.w\n"+
				"mul ft5.xyz,ft5.xyz,ft5.w\n"+
				"add ft0.xyz,ft0.xyz,ft5.xyz\n"+
		
				
				"mov oc, ft0";
		}
	}
}